#ifndef _GAMESTATEMANAGER_H_
#define _GAMESTATEMANAGER_H_

#include "glfw.h"

#include "igamestate.h"

#include "gameinfo.h"
#include "gamemodel.h"

#include "game.h"
#include "promotion.h"
#include "menu.h"
#include "confirmquit.h"

enum GameStateType
{
    GST_GAME = 0,
    GST_PROMOTION,
    GST_MENU,
    GST_ENDSCREEN,
    GST_CONFIRMQUIT
};

class GameStateManager
{
public:
    GameStateManager();
    ~GameStateManager();

    // updates the current game state -> calls update() on current game state
    void update(float dt, const Input& input);

    // draws the current game state -> calls draw() on current game state view
    void draw();

    // switches the current state
    void pushState(GameStateType state);

    // checks if game has ended
    bool isRunning();

private:

    // Should the app continue running
    bool _isRunning;

    // Active game states
    std::vector<IGameState*> _stateStack;

    // Game states
    std::map<GameStateType, IGameState*> _stateMap;

};

#endif // _GAMESTATEMANAGER_H_
